(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^3).


The TRS R consists of the following rules:

eq(0, 0) → true
eq(0, s(m)) → false
eq(s(n), 0) → false
eq(s(n), s(m)) → eq(n, m)
le(0, m) → true
le(s(n), 0) → false
le(s(n), s(m)) → le(n, m)
min(cons(0, nil)) → 0
min(cons(s(n), nil)) → s(n)
min(cons(n, cons(m, x))) → if_min(le(n, m), cons(n, cons(m, x)))
if_min(true, cons(n, cons(m, x))) → min(cons(n, x))
if_min(false, cons(n, cons(m, x))) → min(cons(m, x))
replace(n, m, nil) → nil
replace(n, m, cons(k, x)) → if_replace(eq(n, k), n, m, cons(k, x))
if_replace(true, n, m, cons(k, x)) → cons(m, x)
if_replace(false, n, m, cons(k, x)) → cons(k, replace(n, m, x))
sort(nil) → nil
sort(cons(n, x)) → cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))

Rewrite Strategy: INNERMOST

(1) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^3).


The TRS R consists of the following rules:

eq(0, 0) → true [1]
eq(0, s(m)) → false [1]
eq(s(n), 0) → false [1]
eq(s(n), s(m)) → eq(n, m) [1]
le(0, m) → true [1]
le(s(n), 0) → false [1]
le(s(n), s(m)) → le(n, m) [1]
min(cons(0, nil)) → 0 [1]
min(cons(s(n), nil)) → s(n) [1]
min(cons(n, cons(m, x))) → if_min(le(n, m), cons(n, cons(m, x))) [1]
if_min(true, cons(n, cons(m, x))) → min(cons(n, x)) [1]
if_min(false, cons(n, cons(m, x))) → min(cons(m, x)) [1]
replace(n, m, nil) → nil [1]
replace(n, m, cons(k, x)) → if_replace(eq(n, k), n, m, cons(k, x)) [1]
if_replace(true, n, m, cons(k, x)) → cons(m, x) [1]
if_replace(false, n, m, cons(k, x)) → cons(k, replace(n, m, x)) [1]
sort(nil) → nil [1]
sort(cons(n, x)) → cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x))) [1]

Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

eq(0, 0) → true [1]
eq(0, s(m)) → false [1]
eq(s(n), 0) → false [1]
eq(s(n), s(m)) → eq(n, m) [1]
le(0, m) → true [1]
le(s(n), 0) → false [1]
le(s(n), s(m)) → le(n, m) [1]
min(cons(0, nil)) → 0 [1]
min(cons(s(n), nil)) → s(n) [1]
min(cons(n, cons(m, x))) → if_min(le(n, m), cons(n, cons(m, x))) [1]
if_min(true, cons(n, cons(m, x))) → min(cons(n, x)) [1]
if_min(false, cons(n, cons(m, x))) → min(cons(m, x)) [1]
replace(n, m, nil) → nil [1]
replace(n, m, cons(k, x)) → if_replace(eq(n, k), n, m, cons(k, x)) [1]
if_replace(true, n, m, cons(k, x)) → cons(m, x) [1]
if_replace(false, n, m, cons(k, x)) → cons(k, replace(n, m, x)) [1]
sort(nil) → nil [1]
sort(cons(n, x)) → cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x))) [1]

The TRS has the following type information:
eq :: 0:s → 0:s → true:false
0 :: 0:s
true :: true:false
s :: 0:s → 0:s
false :: true:false
le :: 0:s → 0:s → true:false
min :: nil:cons → 0:s
cons :: 0:s → nil:cons → nil:cons
nil :: nil:cons
if_min :: true:false → nil:cons → 0:s
replace :: 0:s → 0:s → nil:cons → nil:cons
if_replace :: true:false → 0:s → 0:s → nil:cons → nil:cons
sort :: nil:cons → nil:cons

Rewrite Strategy: INNERMOST

(5) CompletionProof (UPPER BOUND(ID) transformation)

The transformation into a RNTS is sound, since:

(a) The obligation is a constructor system where every type has a constant constructor,

(b) The following defined symbols do not have to be completely defined, as they can never occur inside other defined symbols:


sort

(c) The following functions are completely defined:

replace
min
eq
le
if_replace
if_min

Due to the following rules being added:

min(v0) → 0 [0]
if_replace(v0, v1, v2, v3) → nil [0]
if_min(v0, v1) → 0 [0]

And the following fresh constants: none

(6) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

eq(0, 0) → true [1]
eq(0, s(m)) → false [1]
eq(s(n), 0) → false [1]
eq(s(n), s(m)) → eq(n, m) [1]
le(0, m) → true [1]
le(s(n), 0) → false [1]
le(s(n), s(m)) → le(n, m) [1]
min(cons(0, nil)) → 0 [1]
min(cons(s(n), nil)) → s(n) [1]
min(cons(n, cons(m, x))) → if_min(le(n, m), cons(n, cons(m, x))) [1]
if_min(true, cons(n, cons(m, x))) → min(cons(n, x)) [1]
if_min(false, cons(n, cons(m, x))) → min(cons(m, x)) [1]
replace(n, m, nil) → nil [1]
replace(n, m, cons(k, x)) → if_replace(eq(n, k), n, m, cons(k, x)) [1]
if_replace(true, n, m, cons(k, x)) → cons(m, x) [1]
if_replace(false, n, m, cons(k, x)) → cons(k, replace(n, m, x)) [1]
sort(nil) → nil [1]
sort(cons(n, x)) → cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x))) [1]
min(v0) → 0 [0]
if_replace(v0, v1, v2, v3) → nil [0]
if_min(v0, v1) → 0 [0]

The TRS has the following type information:
eq :: 0:s → 0:s → true:false
0 :: 0:s
true :: true:false
s :: 0:s → 0:s
false :: true:false
le :: 0:s → 0:s → true:false
min :: nil:cons → 0:s
cons :: 0:s → nil:cons → nil:cons
nil :: nil:cons
if_min :: true:false → nil:cons → 0:s
replace :: 0:s → 0:s → nil:cons → nil:cons
if_replace :: true:false → 0:s → 0:s → nil:cons → nil:cons
sort :: nil:cons → nil:cons

Rewrite Strategy: INNERMOST

(7) NarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Narrowed the inner basic terms of all right-hand sides by a single narrowing step.

(8) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

eq(0, 0) → true [1]
eq(0, s(m)) → false [1]
eq(s(n), 0) → false [1]
eq(s(n), s(m)) → eq(n, m) [1]
le(0, m) → true [1]
le(s(n), 0) → false [1]
le(s(n), s(m)) → le(n, m) [1]
min(cons(0, nil)) → 0 [1]
min(cons(s(n), nil)) → s(n) [1]
min(cons(0, cons(m, x))) → if_min(true, cons(0, cons(m, x))) [2]
min(cons(s(n'), cons(0, x))) → if_min(false, cons(s(n'), cons(0, x))) [2]
min(cons(s(n''), cons(s(m'), x))) → if_min(le(n'', m'), cons(s(n''), cons(s(m'), x))) [2]
if_min(true, cons(n, cons(m, x))) → min(cons(n, x)) [1]
if_min(false, cons(n, cons(m, x))) → min(cons(m, x)) [1]
replace(n, m, nil) → nil [1]
replace(0, m, cons(0, x)) → if_replace(true, 0, m, cons(0, x)) [2]
replace(0, m, cons(s(m''), x)) → if_replace(false, 0, m, cons(s(m''), x)) [2]
replace(s(n1), m, cons(0, x)) → if_replace(false, s(n1), m, cons(0, x)) [2]
replace(s(n2), m, cons(s(m1), x)) → if_replace(eq(n2, m1), s(n2), m, cons(s(m1), x)) [2]
if_replace(true, n, m, cons(k, x)) → cons(m, x) [1]
if_replace(false, n, m, cons(k, x)) → cons(k, replace(n, m, x)) [1]
sort(nil) → nil [1]
sort(cons(0, nil)) → cons(min(cons(0, nil)), sort(replace(0, 0, nil))) [2]
sort(cons(s(n3), nil)) → cons(min(cons(s(n3), nil)), sort(replace(s(n3), s(n3), nil))) [2]
sort(cons(n, cons(m2, x'))) → cons(min(cons(n, cons(m2, x'))), sort(replace(if_min(le(n, m2), cons(n, cons(m2, x'))), n, cons(m2, x')))) [2]
sort(cons(n, x)) → cons(min(cons(n, x)), sort(replace(0, n, x))) [1]
min(v0) → 0 [0]
if_replace(v0, v1, v2, v3) → nil [0]
if_min(v0, v1) → 0 [0]

The TRS has the following type information:
eq :: 0:s → 0:s → true:false
0 :: 0:s
true :: true:false
s :: 0:s → 0:s
false :: true:false
le :: 0:s → 0:s → true:false
min :: nil:cons → 0:s
cons :: 0:s → nil:cons → nil:cons
nil :: nil:cons
if_min :: true:false → nil:cons → 0:s
replace :: 0:s → 0:s → nil:cons → nil:cons
if_replace :: true:false → 0:s → 0:s → nil:cons → nil:cons
sort :: nil:cons → nil:cons

Rewrite Strategy: INNERMOST

(9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

0 => 0
true => 1
false => 0
nil => 0

(10) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 }→ eq(n, m) :|: n >= 0, z' = 1 + m, z = 1 + n, m >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' = 1 + m, m >= 0
eq(z, z') -{ 1 }→ 0 :|: n >= 0, z = 1 + n, z' = 0
if_min(z, z') -{ 1 }→ min(1 + m + x) :|: n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 1 }→ min(1 + n + x) :|: n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z1 = v3, v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0, v3 >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + k + replace(n, m, x) :|: n >= 0, x >= 0, z1 = 1 + k + x, z' = n, k >= 0, z = 0, z'' = m, m >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + m + x :|: n >= 0, z = 1, x >= 0, z1 = 1 + k + x, z' = n, k >= 0, z'' = m, m >= 0
le(z, z') -{ 1 }→ le(n, m) :|: n >= 0, z' = 1 + m, z = 1 + n, m >= 0
le(z, z') -{ 1 }→ 1 :|: z' = m, z = 0, m >= 0
le(z, z') -{ 1 }→ 0 :|: n >= 0, z = 1 + n, z' = 0
min(z) -{ 2 }→ if_min(le(n'', m'), 1 + (1 + n'') + (1 + (1 + m') + x)) :|: x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 2 }→ if_min(1, 1 + 0 + (1 + m + x)) :|: x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 2 }→ if_min(0, 1 + (1 + n') + (1 + 0 + x)) :|: x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: v0 >= 0, z = v0
min(z) -{ 1 }→ 1 + n :|: z = 1 + (1 + n) + 0, n >= 0
replace(z, z', z'') -{ 2 }→ if_replace(eq(n2, m1), 1 + n2, m, 1 + (1 + m1) + x) :|: z = 1 + n2, z' = m, z'' = 1 + (1 + m1) + x, x >= 0, n2 >= 0, m1 >= 0, m >= 0
replace(z, z', z'') -{ 2 }→ if_replace(1, 0, m, 1 + 0 + x) :|: z' = m, x >= 0, z = 0, z'' = 1 + 0 + x, m >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 0, m, 1 + (1 + m'') + x) :|: z' = m, m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, m >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 1 + n1, m, 1 + 0 + x) :|: z = 1 + n1, z' = m, x >= 0, n1 >= 0, z'' = 1 + 0 + x, m >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, n >= 0, z = n, z' = m, m >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 1 }→ 1 + min(1 + n + x) + sort(replace(0, n, x)) :|: n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 2 }→ 1 + min(1 + n + (1 + m2 + x')) + sort(replace(if_min(le(n, m2), 1 + n + (1 + m2 + x')), n, 1 + m2 + x')) :|: n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 2 }→ 1 + min(1 + 0 + 0) + sort(replace(0, 0, 0)) :|: z = 1 + 0 + 0
sort(z) -{ 2 }→ 1 + min(1 + (1 + n3) + 0) + sort(replace(1 + n3, 1 + n3, 0)) :|: z = 1 + (1 + n3) + 0, n3 >= 0

(11) SimplificationProof (BOTH BOUNDS(ID, ID) transformation)

Simplified the RNTS by moving equalities from the constraints into the right-hand sides.

(12) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 }→ eq(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 1 }→ min(1 + m + x) :|: n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 1 }→ min(1 + n + x) :|: n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + k + replace(z', z'', x) :|: z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 }→ le(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 2 }→ if_min(le(n'', m'), 1 + (1 + n'') + (1 + (1 + m') + x)) :|: x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 2 }→ if_min(1, 1 + 0 + (1 + m + x)) :|: x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 2 }→ if_min(0, 1 + (1 + n') + (1 + 0 + x)) :|: x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 2 }→ if_replace(eq(z - 1, m1), 1 + (z - 1), z', 1 + (1 + m1) + x) :|: z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(1, 0, z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 0, z', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 1 + (z - 1), z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 1 }→ 1 + min(1 + n + x) + sort(replace(0, n, x)) :|: n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 2 }→ 1 + min(1 + n + (1 + m2 + x')) + sort(replace(if_min(le(n, m2), 1 + n + (1 + m2 + x')), n, 1 + m2 + x')) :|: n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 2 }→ 1 + min(1 + 0 + 0) + sort(replace(0, 0, 0)) :|: z = 1 + 0 + 0
sort(z) -{ 2 }→ 1 + min(1 + (1 + (z - 2)) + 0) + sort(replace(1 + (z - 2), 1 + (z - 2), 0)) :|: z - 2 >= 0

(13) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID) transformation)

Found the following analysis order by SCC decomposition:

{ le }
{ eq }
{ min, if_min }
{ replace, if_replace }
{ sort }

(14) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 }→ eq(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 1 }→ min(1 + m + x) :|: n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 1 }→ min(1 + n + x) :|: n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + k + replace(z', z'', x) :|: z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 }→ le(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 2 }→ if_min(le(n'', m'), 1 + (1 + n'') + (1 + (1 + m') + x)) :|: x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 2 }→ if_min(1, 1 + 0 + (1 + m + x)) :|: x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 2 }→ if_min(0, 1 + (1 + n') + (1 + 0 + x)) :|: x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 2 }→ if_replace(eq(z - 1, m1), 1 + (z - 1), z', 1 + (1 + m1) + x) :|: z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(1, 0, z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 0, z', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 1 + (z - 1), z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 1 }→ 1 + min(1 + n + x) + sort(replace(0, n, x)) :|: n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 2 }→ 1 + min(1 + n + (1 + m2 + x')) + sort(replace(if_min(le(n, m2), 1 + n + (1 + m2 + x')), n, 1 + m2 + x')) :|: n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 2 }→ 1 + min(1 + 0 + 0) + sort(replace(0, 0, 0)) :|: z = 1 + 0 + 0
sort(z) -{ 2 }→ 1 + min(1 + (1 + (z - 2)) + 0) + sort(replace(1 + (z - 2), 1 + (z - 2), 0)) :|: z - 2 >= 0

Function symbols to be analyzed: {le}, {eq}, {min,if_min}, {replace,if_replace}, {sort}

(15) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: le
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(16) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 }→ eq(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 1 }→ min(1 + m + x) :|: n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 1 }→ min(1 + n + x) :|: n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + k + replace(z', z'', x) :|: z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 }→ le(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 2 }→ if_min(le(n'', m'), 1 + (1 + n'') + (1 + (1 + m') + x)) :|: x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 2 }→ if_min(1, 1 + 0 + (1 + m + x)) :|: x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 2 }→ if_min(0, 1 + (1 + n') + (1 + 0 + x)) :|: x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 2 }→ if_replace(eq(z - 1, m1), 1 + (z - 1), z', 1 + (1 + m1) + x) :|: z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(1, 0, z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 0, z', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 1 + (z - 1), z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 1 }→ 1 + min(1 + n + x) + sort(replace(0, n, x)) :|: n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 2 }→ 1 + min(1 + n + (1 + m2 + x')) + sort(replace(if_min(le(n, m2), 1 + n + (1 + m2 + x')), n, 1 + m2 + x')) :|: n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 2 }→ 1 + min(1 + 0 + 0) + sort(replace(0, 0, 0)) :|: z = 1 + 0 + 0
sort(z) -{ 2 }→ 1 + min(1 + (1 + (z - 2)) + 0) + sort(replace(1 + (z - 2), 1 + (z - 2), 0)) :|: z - 2 >= 0

Function symbols to be analyzed: {le}, {eq}, {min,if_min}, {replace,if_replace}, {sort}
Previous analysis results are:
le: runtime: ?, size: O(1) [1]

(17) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using PUBS for: le
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z'

(18) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 }→ eq(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 1 }→ min(1 + m + x) :|: n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 1 }→ min(1 + n + x) :|: n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + k + replace(z', z'', x) :|: z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 }→ le(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 2 }→ if_min(le(n'', m'), 1 + (1 + n'') + (1 + (1 + m') + x)) :|: x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 2 }→ if_min(1, 1 + 0 + (1 + m + x)) :|: x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 2 }→ if_min(0, 1 + (1 + n') + (1 + 0 + x)) :|: x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 2 }→ if_replace(eq(z - 1, m1), 1 + (z - 1), z', 1 + (1 + m1) + x) :|: z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(1, 0, z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 0, z', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 1 + (z - 1), z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 1 }→ 1 + min(1 + n + x) + sort(replace(0, n, x)) :|: n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 2 }→ 1 + min(1 + n + (1 + m2 + x')) + sort(replace(if_min(le(n, m2), 1 + n + (1 + m2 + x')), n, 1 + m2 + x')) :|: n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 2 }→ 1 + min(1 + 0 + 0) + sort(replace(0, 0, 0)) :|: z = 1 + 0 + 0
sort(z) -{ 2 }→ 1 + min(1 + (1 + (z - 2)) + 0) + sort(replace(1 + (z - 2), 1 + (z - 2), 0)) :|: z - 2 >= 0

Function symbols to be analyzed: {eq}, {min,if_min}, {replace,if_replace}, {sort}
Previous analysis results are:
le: runtime: O(n1) [1 + z'], size: O(1) [1]

(19) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(20) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 }→ eq(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 1 }→ min(1 + m + x) :|: n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 1 }→ min(1 + n + x) :|: n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + k + replace(z', z'', x) :|: z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 1, x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 2 }→ if_min(1, 1 + 0 + (1 + m + x)) :|: x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 2 }→ if_min(0, 1 + (1 + n') + (1 + 0 + x)) :|: x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 2 }→ if_replace(eq(z - 1, m1), 1 + (z - 1), z', 1 + (1 + m1) + x) :|: z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(1, 0, z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 0, z', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 1 + (z - 1), z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 1 }→ 1 + min(1 + n + x) + sort(replace(0, n, x)) :|: n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 3 + m2 }→ 1 + min(1 + n + (1 + m2 + x')) + sort(replace(if_min(s'', 1 + n + (1 + m2 + x')), n, 1 + m2 + x')) :|: s'' >= 0, s'' <= 1, n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 2 }→ 1 + min(1 + 0 + 0) + sort(replace(0, 0, 0)) :|: z = 1 + 0 + 0
sort(z) -{ 2 }→ 1 + min(1 + (1 + (z - 2)) + 0) + sort(replace(1 + (z - 2), 1 + (z - 2), 0)) :|: z - 2 >= 0

Function symbols to be analyzed: {eq}, {min,if_min}, {replace,if_replace}, {sort}
Previous analysis results are:
le: runtime: O(n1) [1 + z'], size: O(1) [1]

(21) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: eq
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(22) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 }→ eq(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 1 }→ min(1 + m + x) :|: n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 1 }→ min(1 + n + x) :|: n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + k + replace(z', z'', x) :|: z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 1, x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 2 }→ if_min(1, 1 + 0 + (1 + m + x)) :|: x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 2 }→ if_min(0, 1 + (1 + n') + (1 + 0 + x)) :|: x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 2 }→ if_replace(eq(z - 1, m1), 1 + (z - 1), z', 1 + (1 + m1) + x) :|: z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(1, 0, z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 0, z', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 1 + (z - 1), z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 1 }→ 1 + min(1 + n + x) + sort(replace(0, n, x)) :|: n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 3 + m2 }→ 1 + min(1 + n + (1 + m2 + x')) + sort(replace(if_min(s'', 1 + n + (1 + m2 + x')), n, 1 + m2 + x')) :|: s'' >= 0, s'' <= 1, n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 2 }→ 1 + min(1 + 0 + 0) + sort(replace(0, 0, 0)) :|: z = 1 + 0 + 0
sort(z) -{ 2 }→ 1 + min(1 + (1 + (z - 2)) + 0) + sort(replace(1 + (z - 2), 1 + (z - 2), 0)) :|: z - 2 >= 0

Function symbols to be analyzed: {eq}, {min,if_min}, {replace,if_replace}, {sort}
Previous analysis results are:
le: runtime: O(n1) [1 + z'], size: O(1) [1]
eq: runtime: ?, size: O(1) [1]

(23) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using PUBS for: eq
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z'

(24) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 }→ eq(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 1 }→ min(1 + m + x) :|: n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 1 }→ min(1 + n + x) :|: n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + k + replace(z', z'', x) :|: z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 1, x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 2 }→ if_min(1, 1 + 0 + (1 + m + x)) :|: x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 2 }→ if_min(0, 1 + (1 + n') + (1 + 0 + x)) :|: x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 2 }→ if_replace(eq(z - 1, m1), 1 + (z - 1), z', 1 + (1 + m1) + x) :|: z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(1, 0, z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 0, z', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 1 + (z - 1), z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 1 }→ 1 + min(1 + n + x) + sort(replace(0, n, x)) :|: n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 3 + m2 }→ 1 + min(1 + n + (1 + m2 + x')) + sort(replace(if_min(s'', 1 + n + (1 + m2 + x')), n, 1 + m2 + x')) :|: s'' >= 0, s'' <= 1, n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 2 }→ 1 + min(1 + 0 + 0) + sort(replace(0, 0, 0)) :|: z = 1 + 0 + 0
sort(z) -{ 2 }→ 1 + min(1 + (1 + (z - 2)) + 0) + sort(replace(1 + (z - 2), 1 + (z - 2), 0)) :|: z - 2 >= 0

Function symbols to be analyzed: {min,if_min}, {replace,if_replace}, {sort}
Previous analysis results are:
le: runtime: O(n1) [1 + z'], size: O(1) [1]
eq: runtime: O(n1) [1 + z'], size: O(1) [1]

(25) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(26) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 + z' }→ s1 :|: s1 >= 0, s1 <= 1, z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 1 }→ min(1 + m + x) :|: n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 1 }→ min(1 + n + x) :|: n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + k + replace(z', z'', x) :|: z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 1, x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 2 }→ if_min(1, 1 + 0 + (1 + m + x)) :|: x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 2 }→ if_min(0, 1 + (1 + n') + (1 + 0 + x)) :|: x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 3 + m1 }→ if_replace(s2, 1 + (z - 1), z', 1 + (1 + m1) + x) :|: s2 >= 0, s2 <= 1, z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(1, 0, z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 0, z', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 1 + (z - 1), z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 1 }→ 1 + min(1 + n + x) + sort(replace(0, n, x)) :|: n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 3 + m2 }→ 1 + min(1 + n + (1 + m2 + x')) + sort(replace(if_min(s'', 1 + n + (1 + m2 + x')), n, 1 + m2 + x')) :|: s'' >= 0, s'' <= 1, n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 2 }→ 1 + min(1 + 0 + 0) + sort(replace(0, 0, 0)) :|: z = 1 + 0 + 0
sort(z) -{ 2 }→ 1 + min(1 + (1 + (z - 2)) + 0) + sort(replace(1 + (z - 2), 1 + (z - 2), 0)) :|: z - 2 >= 0

Function symbols to be analyzed: {min,if_min}, {replace,if_replace}, {sort}
Previous analysis results are:
le: runtime: O(n1) [1 + z'], size: O(1) [1]
eq: runtime: O(n1) [1 + z'], size: O(1) [1]

(27) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: min
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z

Computed SIZE bound using KoAT for: if_min
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z'

(28) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 + z' }→ s1 :|: s1 >= 0, s1 <= 1, z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 1 }→ min(1 + m + x) :|: n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 1 }→ min(1 + n + x) :|: n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + k + replace(z', z'', x) :|: z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 1, x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 2 }→ if_min(1, 1 + 0 + (1 + m + x)) :|: x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 2 }→ if_min(0, 1 + (1 + n') + (1 + 0 + x)) :|: x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 3 + m1 }→ if_replace(s2, 1 + (z - 1), z', 1 + (1 + m1) + x) :|: s2 >= 0, s2 <= 1, z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(1, 0, z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 0, z', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 1 + (z - 1), z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 1 }→ 1 + min(1 + n + x) + sort(replace(0, n, x)) :|: n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 3 + m2 }→ 1 + min(1 + n + (1 + m2 + x')) + sort(replace(if_min(s'', 1 + n + (1 + m2 + x')), n, 1 + m2 + x')) :|: s'' >= 0, s'' <= 1, n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 2 }→ 1 + min(1 + 0 + 0) + sort(replace(0, 0, 0)) :|: z = 1 + 0 + 0
sort(z) -{ 2 }→ 1 + min(1 + (1 + (z - 2)) + 0) + sort(replace(1 + (z - 2), 1 + (z - 2), 0)) :|: z - 2 >= 0

Function symbols to be analyzed: {min,if_min}, {replace,if_replace}, {sort}
Previous analysis results are:
le: runtime: O(n1) [1 + z'], size: O(1) [1]
eq: runtime: O(n1) [1 + z'], size: O(1) [1]
min: runtime: ?, size: O(n1) [z]
if_min: runtime: ?, size: O(n1) [z']

(29) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: min
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 5 + 4·z + z2

Computed RUNTIME bound using KoAT for: if_min
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 22 + 24·z' + 8·z'2

(30) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 + z' }→ s1 :|: s1 >= 0, s1 <= 1, z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 1 }→ min(1 + m + x) :|: n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 1 }→ min(1 + n + x) :|: n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + k + replace(z', z'', x) :|: z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 1, x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 2 }→ if_min(1, 1 + 0 + (1 + m + x)) :|: x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 2 }→ if_min(0, 1 + (1 + n') + (1 + 0 + x)) :|: x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 3 + m1 }→ if_replace(s2, 1 + (z - 1), z', 1 + (1 + m1) + x) :|: s2 >= 0, s2 <= 1, z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(1, 0, z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 0, z', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 1 + (z - 1), z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 1 }→ 1 + min(1 + n + x) + sort(replace(0, n, x)) :|: n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 3 + m2 }→ 1 + min(1 + n + (1 + m2 + x')) + sort(replace(if_min(s'', 1 + n + (1 + m2 + x')), n, 1 + m2 + x')) :|: s'' >= 0, s'' <= 1, n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 2 }→ 1 + min(1 + 0 + 0) + sort(replace(0, 0, 0)) :|: z = 1 + 0 + 0
sort(z) -{ 2 }→ 1 + min(1 + (1 + (z - 2)) + 0) + sort(replace(1 + (z - 2), 1 + (z - 2), 0)) :|: z - 2 >= 0

Function symbols to be analyzed: {replace,if_replace}, {sort}
Previous analysis results are:
le: runtime: O(n1) [1 + z'], size: O(1) [1]
eq: runtime: O(n1) [1 + z'], size: O(1) [1]
min: runtime: O(n2) [5 + 4·z + z2], size: O(n1) [z]
if_min: runtime: O(n2) [22 + 24·z' + 8·z'2], size: O(n1) [z']

(31) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(32) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 + z' }→ s1 :|: s1 >= 0, s1 <= 1, z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ s6 :|: s6 >= 0, s6 <= 1 * (1 + n + x), n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 11 + 6·m + 2·m·x + m2 + 6·x + x2 }→ s7 :|: s7 >= 0, s7 <= 1 * (1 + m + x), n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + k + replace(z', z'', x) :|: z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 104 + 56·m + 16·m·x + 8·m2 + 56·x + 8·x2 }→ s3 :|: s3 >= 0, s3 <= 1 * (1 + 0 + (1 + m + x)), x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 168 + 72·n' + 16·n'·x + 8·n'2 + 72·x + 8·x2 }→ s4 :|: s4 >= 0, s4 <= 1 * (1 + (1 + n') + (1 + 0 + x)), x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 249 + 89·m' + 16·m'·n'' + 16·m'·x + 8·m'2 + 88·n'' + 16·n''·x + 8·n''2 + 88·x + 8·x2 }→ s5 :|: s5 >= 0, s5 <= 1 * (1 + (1 + n'') + (1 + (1 + m') + x)), s' >= 0, s' <= 1, x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 3 + m1 }→ if_replace(s2, 1 + (z - 1), z', 1 + (1 + m1) + x) :|: s2 >= 0, s2 <= 1, z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(1, 0, z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 0, z', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 1 + (z - 1), z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 122 + 65·m2 + 18·m2·n + 18·m2·x' + 9·m22 + 64·n + 18·n·x' + 9·n2 + 64·x' + 9·x'2 }→ 1 + s10 + sort(replace(s11, n, 1 + m2 + x')) :|: s10 >= 0, s10 <= 1 * (1 + n + (1 + m2 + x')), s11 >= 0, s11 <= 1 * (1 + n + (1 + m2 + x')), s'' >= 0, s'' <= 1, n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ 1 + s12 + sort(replace(0, n, x)) :|: s12 >= 0, s12 <= 1 * (1 + n + x), n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 12 }→ 1 + s8 + sort(replace(0, 0, 0)) :|: s8 >= 0, s8 <= 1 * (1 + 0 + 0), z = 1 + 0 + 0
sort(z) -{ 7 + 4·z + z2 }→ 1 + s9 + sort(replace(1 + (z - 2), 1 + (z - 2), 0)) :|: s9 >= 0, s9 <= 1 * (1 + (1 + (z - 2)) + 0), z - 2 >= 0

Function symbols to be analyzed: {replace,if_replace}, {sort}
Previous analysis results are:
le: runtime: O(n1) [1 + z'], size: O(1) [1]
eq: runtime: O(n1) [1 + z'], size: O(1) [1]
min: runtime: O(n2) [5 + 4·z + z2], size: O(n1) [z]
if_min: runtime: O(n2) [22 + 24·z' + 8·z'2], size: O(n1) [z']

(33) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: replace
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z' + z''

Computed SIZE bound using CoFloCo for: if_replace
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z'' + z1

(34) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 + z' }→ s1 :|: s1 >= 0, s1 <= 1, z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ s6 :|: s6 >= 0, s6 <= 1 * (1 + n + x), n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 11 + 6·m + 2·m·x + m2 + 6·x + x2 }→ s7 :|: s7 >= 0, s7 <= 1 * (1 + m + x), n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + k + replace(z', z'', x) :|: z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 104 + 56·m + 16·m·x + 8·m2 + 56·x + 8·x2 }→ s3 :|: s3 >= 0, s3 <= 1 * (1 + 0 + (1 + m + x)), x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 168 + 72·n' + 16·n'·x + 8·n'2 + 72·x + 8·x2 }→ s4 :|: s4 >= 0, s4 <= 1 * (1 + (1 + n') + (1 + 0 + x)), x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 249 + 89·m' + 16·m'·n'' + 16·m'·x + 8·m'2 + 88·n'' + 16·n''·x + 8·n''2 + 88·x + 8·x2 }→ s5 :|: s5 >= 0, s5 <= 1 * (1 + (1 + n'') + (1 + (1 + m') + x)), s' >= 0, s' <= 1, x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 3 + m1 }→ if_replace(s2, 1 + (z - 1), z', 1 + (1 + m1) + x) :|: s2 >= 0, s2 <= 1, z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(1, 0, z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 0, z', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 1 + (z - 1), z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 122 + 65·m2 + 18·m2·n + 18·m2·x' + 9·m22 + 64·n + 18·n·x' + 9·n2 + 64·x' + 9·x'2 }→ 1 + s10 + sort(replace(s11, n, 1 + m2 + x')) :|: s10 >= 0, s10 <= 1 * (1 + n + (1 + m2 + x')), s11 >= 0, s11 <= 1 * (1 + n + (1 + m2 + x')), s'' >= 0, s'' <= 1, n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ 1 + s12 + sort(replace(0, n, x)) :|: s12 >= 0, s12 <= 1 * (1 + n + x), n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 12 }→ 1 + s8 + sort(replace(0, 0, 0)) :|: s8 >= 0, s8 <= 1 * (1 + 0 + 0), z = 1 + 0 + 0
sort(z) -{ 7 + 4·z + z2 }→ 1 + s9 + sort(replace(1 + (z - 2), 1 + (z - 2), 0)) :|: s9 >= 0, s9 <= 1 * (1 + (1 + (z - 2)) + 0), z - 2 >= 0

Function symbols to be analyzed: {replace,if_replace}, {sort}
Previous analysis results are:
le: runtime: O(n1) [1 + z'], size: O(1) [1]
eq: runtime: O(n1) [1 + z'], size: O(1) [1]
min: runtime: O(n2) [5 + 4·z + z2], size: O(n1) [z]
if_min: runtime: O(n2) [22 + 24·z' + 8·z'2], size: O(n1) [z']
replace: runtime: ?, size: O(n1) [z' + z'']
if_replace: runtime: ?, size: O(n1) [z'' + z1]

(35) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: replace
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 6 + 4·z'' + z''2

Computed RUNTIME bound using KoAT for: if_replace
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 8 + 4·z1 + z12

(36) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 + z' }→ s1 :|: s1 >= 0, s1 <= 1, z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ s6 :|: s6 >= 0, s6 <= 1 * (1 + n + x), n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 11 + 6·m + 2·m·x + m2 + 6·x + x2 }→ s7 :|: s7 >= 0, s7 <= 1 * (1 + m + x), n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + k + replace(z', z'', x) :|: z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 104 + 56·m + 16·m·x + 8·m2 + 56·x + 8·x2 }→ s3 :|: s3 >= 0, s3 <= 1 * (1 + 0 + (1 + m + x)), x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 168 + 72·n' + 16·n'·x + 8·n'2 + 72·x + 8·x2 }→ s4 :|: s4 >= 0, s4 <= 1 * (1 + (1 + n') + (1 + 0 + x)), x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 249 + 89·m' + 16·m'·n'' + 16·m'·x + 8·m'2 + 88·n'' + 16·n''·x + 8·n''2 + 88·x + 8·x2 }→ s5 :|: s5 >= 0, s5 <= 1 * (1 + (1 + n'') + (1 + (1 + m') + x)), s' >= 0, s' <= 1, x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 3 + m1 }→ if_replace(s2, 1 + (z - 1), z', 1 + (1 + m1) + x) :|: s2 >= 0, s2 <= 1, z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(1, 0, z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 0, z', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 2 }→ if_replace(0, 1 + (z - 1), z', 1 + 0 + (z'' - 1)) :|: z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 122 + 65·m2 + 18·m2·n + 18·m2·x' + 9·m22 + 64·n + 18·n·x' + 9·n2 + 64·x' + 9·x'2 }→ 1 + s10 + sort(replace(s11, n, 1 + m2 + x')) :|: s10 >= 0, s10 <= 1 * (1 + n + (1 + m2 + x')), s11 >= 0, s11 <= 1 * (1 + n + (1 + m2 + x')), s'' >= 0, s'' <= 1, n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ 1 + s12 + sort(replace(0, n, x)) :|: s12 >= 0, s12 <= 1 * (1 + n + x), n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 12 }→ 1 + s8 + sort(replace(0, 0, 0)) :|: s8 >= 0, s8 <= 1 * (1 + 0 + 0), z = 1 + 0 + 0
sort(z) -{ 7 + 4·z + z2 }→ 1 + s9 + sort(replace(1 + (z - 2), 1 + (z - 2), 0)) :|: s9 >= 0, s9 <= 1 * (1 + (1 + (z - 2)) + 0), z - 2 >= 0

Function symbols to be analyzed: {sort}
Previous analysis results are:
le: runtime: O(n1) [1 + z'], size: O(1) [1]
eq: runtime: O(n1) [1 + z'], size: O(1) [1]
min: runtime: O(n2) [5 + 4·z + z2], size: O(n1) [z]
if_min: runtime: O(n2) [22 + 24·z' + 8·z'2], size: O(n1) [z']
replace: runtime: O(n2) [6 + 4·z'' + z''2], size: O(n1) [z' + z'']
if_replace: runtime: O(n2) [8 + 4·z1 + z12], size: O(n1) [z'' + z1]

(37) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(38) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 + z' }→ s1 :|: s1 >= 0, s1 <= 1, z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ s6 :|: s6 >= 0, s6 <= 1 * (1 + n + x), n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 11 + 6·m + 2·m·x + m2 + 6·x + x2 }→ s7 :|: s7 >= 0, s7 <= 1 * (1 + m + x), n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 7 + 4·x + x2 }→ 1 + k + s17 :|: s17 >= 0, s17 <= 1 * z'' + 1 * x, z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 104 + 56·m + 16·m·x + 8·m2 + 56·x + 8·x2 }→ s3 :|: s3 >= 0, s3 <= 1 * (1 + 0 + (1 + m + x)), x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 168 + 72·n' + 16·n'·x + 8·n'2 + 72·x + 8·x2 }→ s4 :|: s4 >= 0, s4 <= 1 * (1 + (1 + n') + (1 + 0 + x)), x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 249 + 89·m' + 16·m'·n'' + 16·m'·x + 8·m'2 + 88·n'' + 16·n''·x + 8·n''2 + 88·x + 8·x2 }→ s5 :|: s5 >= 0, s5 <= 1 * (1 + (1 + n'') + (1 + (1 + m') + x)), s' >= 0, s' <= 1, x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 10 + 4·z'' + z''2 }→ s13 :|: s13 >= 0, s13 <= 1 * z' + 1 * (1 + 0 + (z'' - 1)), z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 22 + 8·m'' + 2·m''·x + m''2 + 8·x + x2 }→ s14 :|: s14 >= 0, s14 <= 1 * z' + 1 * (1 + (1 + m'') + x), m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 10 + 4·z'' + z''2 }→ s15 :|: s15 >= 0, s15 <= 1 * z' + 1 * (1 + 0 + (z'' - 1)), z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 23 + 9·m1 + 2·m1·x + m12 + 8·x + x2 }→ s16 :|: s16 >= 0, s16 <= 1 * z' + 1 * (1 + (1 + m1) + x), s2 >= 0, s2 <= 1, z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 133 + 71·m2 + 18·m2·n + 20·m2·x' + 10·m22 + 64·n + 18·n·x' + 9·n2 + 70·x' + 10·x'2 }→ 1 + s10 + sort(s20) :|: s20 >= 0, s20 <= 1 * n + 1 * (1 + m2 + x'), s10 >= 0, s10 <= 1 * (1 + n + (1 + m2 + x')), s11 >= 0, s11 <= 1 * (1 + n + (1 + m2 + x')), s'' >= 0, s'' <= 1, n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 17 + 6·n + 2·n·x + n2 + 10·x + 2·x2 }→ 1 + s12 + sort(s21) :|: s21 >= 0, s21 <= 1 * n + 1 * x, s12 >= 0, s12 <= 1 * (1 + n + x), n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 18 }→ 1 + s8 + sort(s18) :|: s18 >= 0, s18 <= 1 * 0 + 1 * 0, s8 >= 0, s8 <= 1 * (1 + 0 + 0), z = 1 + 0 + 0
sort(z) -{ 13 + 4·z + z2 }→ 1 + s9 + sort(s19) :|: s19 >= 0, s19 <= 1 * (1 + (z - 2)) + 1 * 0, s9 >= 0, s9 <= 1 * (1 + (1 + (z - 2)) + 0), z - 2 >= 0

Function symbols to be analyzed: {sort}
Previous analysis results are:
le: runtime: O(n1) [1 + z'], size: O(1) [1]
eq: runtime: O(n1) [1 + z'], size: O(1) [1]
min: runtime: O(n2) [5 + 4·z + z2], size: O(n1) [z]
if_min: runtime: O(n2) [22 + 24·z' + 8·z'2], size: O(n1) [z']
replace: runtime: O(n2) [6 + 4·z'' + z''2], size: O(n1) [z' + z'']
if_replace: runtime: O(n2) [8 + 4·z1 + z12], size: O(n1) [z'' + z1]

(39) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: sort
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: z + z2

(40) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 + z' }→ s1 :|: s1 >= 0, s1 <= 1, z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ s6 :|: s6 >= 0, s6 <= 1 * (1 + n + x), n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 11 + 6·m + 2·m·x + m2 + 6·x + x2 }→ s7 :|: s7 >= 0, s7 <= 1 * (1 + m + x), n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 7 + 4·x + x2 }→ 1 + k + s17 :|: s17 >= 0, s17 <= 1 * z'' + 1 * x, z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 104 + 56·m + 16·m·x + 8·m2 + 56·x + 8·x2 }→ s3 :|: s3 >= 0, s3 <= 1 * (1 + 0 + (1 + m + x)), x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 168 + 72·n' + 16·n'·x + 8·n'2 + 72·x + 8·x2 }→ s4 :|: s4 >= 0, s4 <= 1 * (1 + (1 + n') + (1 + 0 + x)), x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 249 + 89·m' + 16·m'·n'' + 16·m'·x + 8·m'2 + 88·n'' + 16·n''·x + 8·n''2 + 88·x + 8·x2 }→ s5 :|: s5 >= 0, s5 <= 1 * (1 + (1 + n'') + (1 + (1 + m') + x)), s' >= 0, s' <= 1, x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 10 + 4·z'' + z''2 }→ s13 :|: s13 >= 0, s13 <= 1 * z' + 1 * (1 + 0 + (z'' - 1)), z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 22 + 8·m'' + 2·m''·x + m''2 + 8·x + x2 }→ s14 :|: s14 >= 0, s14 <= 1 * z' + 1 * (1 + (1 + m'') + x), m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 10 + 4·z'' + z''2 }→ s15 :|: s15 >= 0, s15 <= 1 * z' + 1 * (1 + 0 + (z'' - 1)), z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 23 + 9·m1 + 2·m1·x + m12 + 8·x + x2 }→ s16 :|: s16 >= 0, s16 <= 1 * z' + 1 * (1 + (1 + m1) + x), s2 >= 0, s2 <= 1, z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 133 + 71·m2 + 18·m2·n + 20·m2·x' + 10·m22 + 64·n + 18·n·x' + 9·n2 + 70·x' + 10·x'2 }→ 1 + s10 + sort(s20) :|: s20 >= 0, s20 <= 1 * n + 1 * (1 + m2 + x'), s10 >= 0, s10 <= 1 * (1 + n + (1 + m2 + x')), s11 >= 0, s11 <= 1 * (1 + n + (1 + m2 + x')), s'' >= 0, s'' <= 1, n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 17 + 6·n + 2·n·x + n2 + 10·x + 2·x2 }→ 1 + s12 + sort(s21) :|: s21 >= 0, s21 <= 1 * n + 1 * x, s12 >= 0, s12 <= 1 * (1 + n + x), n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 18 }→ 1 + s8 + sort(s18) :|: s18 >= 0, s18 <= 1 * 0 + 1 * 0, s8 >= 0, s8 <= 1 * (1 + 0 + 0), z = 1 + 0 + 0
sort(z) -{ 13 + 4·z + z2 }→ 1 + s9 + sort(s19) :|: s19 >= 0, s19 <= 1 * (1 + (z - 2)) + 1 * 0, s9 >= 0, s9 <= 1 * (1 + (1 + (z - 2)) + 0), z - 2 >= 0

Function symbols to be analyzed: {sort}
Previous analysis results are:
le: runtime: O(n1) [1 + z'], size: O(1) [1]
eq: runtime: O(n1) [1 + z'], size: O(1) [1]
min: runtime: O(n2) [5 + 4·z + z2], size: O(n1) [z]
if_min: runtime: O(n2) [22 + 24·z' + 8·z'2], size: O(n1) [z']
replace: runtime: O(n2) [6 + 4·z'' + z''2], size: O(n1) [z' + z'']
if_replace: runtime: O(n2) [8 + 4·z1 + z12], size: O(n1) [z'' + z1]
sort: runtime: ?, size: O(n2) [z + z2]

(41) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using KoAT for: sort
after applying outer abstraction to obtain an ITS,
resulting in: O(n3) with polynomial bound: 1 + 181·z + 225·z2 + 91·z3

(42) Obligation:

Complexity RNTS consisting of the following rules:

eq(z, z') -{ 1 + z' }→ s1 :|: s1 >= 0, s1 <= 1, z - 1 >= 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 1 :|: z = 0, z' = 0
eq(z, z') -{ 1 }→ 0 :|: z = 0, z' - 1 >= 0
eq(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
if_min(z, z') -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ s6 :|: s6 >= 0, s6 <= 1 * (1 + n + x), n >= 0, z = 1, x >= 0, z' = 1 + n + (1 + m + x), m >= 0
if_min(z, z') -{ 11 + 6·m + 2·m·x + m2 + 6·x + x2 }→ s7 :|: s7 >= 0, s7 <= 1 * (1 + m + x), n >= 0, x >= 0, z' = 1 + n + (1 + m + x), z = 0, m >= 0
if_min(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
if_replace(z, z', z'', z1) -{ 0 }→ 0 :|: z >= 0, z' >= 0, z'' >= 0, z1 >= 0
if_replace(z, z', z'', z1) -{ 7 + 4·x + x2 }→ 1 + k + s17 :|: s17 >= 0, s17 <= 1 * z'' + 1 * x, z' >= 0, x >= 0, z1 = 1 + k + x, k >= 0, z = 0, z'' >= 0
if_replace(z, z', z'', z1) -{ 1 }→ 1 + z'' + x :|: z' >= 0, z = 1, x >= 0, z1 = 1 + k + x, k >= 0, z'' >= 0
le(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1, z - 1 >= 0, z' - 1 >= 0
le(z, z') -{ 1 }→ 1 :|: z = 0, z' >= 0
le(z, z') -{ 1 }→ 0 :|: z - 1 >= 0, z' = 0
min(z) -{ 104 + 56·m + 16·m·x + 8·m2 + 56·x + 8·x2 }→ s3 :|: s3 >= 0, s3 <= 1 * (1 + 0 + (1 + m + x)), x >= 0, z = 1 + 0 + (1 + m + x), m >= 0
min(z) -{ 168 + 72·n' + 16·n'·x + 8·n'2 + 72·x + 8·x2 }→ s4 :|: s4 >= 0, s4 <= 1 * (1 + (1 + n') + (1 + 0 + x)), x >= 0, z = 1 + (1 + n') + (1 + 0 + x), n' >= 0
min(z) -{ 249 + 89·m' + 16·m'·n'' + 16·m'·x + 8·m'2 + 88·n'' + 16·n''·x + 8·n''2 + 88·x + 8·x2 }→ s5 :|: s5 >= 0, s5 <= 1 * (1 + (1 + n'') + (1 + (1 + m') + x)), s' >= 0, s' <= 1, x >= 0, z = 1 + (1 + n'') + (1 + (1 + m') + x), m' >= 0, n'' >= 0
min(z) -{ 1 }→ 0 :|: z = 1 + 0 + 0
min(z) -{ 0 }→ 0 :|: z >= 0
min(z) -{ 1 }→ 1 + (z - 2) :|: z - 2 >= 0
replace(z, z', z'') -{ 10 + 4·z'' + z''2 }→ s13 :|: s13 >= 0, s13 <= 1 * z' + 1 * (1 + 0 + (z'' - 1)), z'' - 1 >= 0, z = 0, z' >= 0
replace(z, z', z'') -{ 22 + 8·m'' + 2·m''·x + m''2 + 8·x + x2 }→ s14 :|: s14 >= 0, s14 <= 1 * z' + 1 * (1 + (1 + m'') + x), m'' >= 0, x >= 0, z'' = 1 + (1 + m'') + x, z = 0, z' >= 0
replace(z, z', z'') -{ 10 + 4·z'' + z''2 }→ s15 :|: s15 >= 0, s15 <= 1 * z' + 1 * (1 + 0 + (z'' - 1)), z'' - 1 >= 0, z - 1 >= 0, z' >= 0
replace(z, z', z'') -{ 23 + 9·m1 + 2·m1·x + m12 + 8·x + x2 }→ s16 :|: s16 >= 0, s16 <= 1 * z' + 1 * (1 + (1 + m1) + x), s2 >= 0, s2 <= 1, z'' = 1 + (1 + m1) + x, x >= 0, z - 1 >= 0, m1 >= 0, z' >= 0
replace(z, z', z'') -{ 1 }→ 0 :|: z'' = 0, z >= 0, z' >= 0
sort(z) -{ 1 }→ 0 :|: z = 0
sort(z) -{ 133 + 71·m2 + 18·m2·n + 20·m2·x' + 10·m22 + 64·n + 18·n·x' + 9·n2 + 70·x' + 10·x'2 }→ 1 + s10 + sort(s20) :|: s20 >= 0, s20 <= 1 * n + 1 * (1 + m2 + x'), s10 >= 0, s10 <= 1 * (1 + n + (1 + m2 + x')), s11 >= 0, s11 <= 1 * (1 + n + (1 + m2 + x')), s'' >= 0, s'' <= 1, n >= 0, x' >= 0, z = 1 + n + (1 + m2 + x'), m2 >= 0
sort(z) -{ 17 + 6·n + 2·n·x + n2 + 10·x + 2·x2 }→ 1 + s12 + sort(s21) :|: s21 >= 0, s21 <= 1 * n + 1 * x, s12 >= 0, s12 <= 1 * (1 + n + x), n >= 0, x >= 0, z = 1 + n + x
sort(z) -{ 18 }→ 1 + s8 + sort(s18) :|: s18 >= 0, s18 <= 1 * 0 + 1 * 0, s8 >= 0, s8 <= 1 * (1 + 0 + 0), z = 1 + 0 + 0
sort(z) -{ 13 + 4·z + z2 }→ 1 + s9 + sort(s19) :|: s19 >= 0, s19 <= 1 * (1 + (z - 2)) + 1 * 0, s9 >= 0, s9 <= 1 * (1 + (1 + (z - 2)) + 0), z - 2 >= 0

Function symbols to be analyzed:
Previous analysis results are:
le: runtime: O(n1) [1 + z'], size: O(1) [1]
eq: runtime: O(n1) [1 + z'], size: O(1) [1]
min: runtime: O(n2) [5 + 4·z + z2], size: O(n1) [z]
if_min: runtime: O(n2) [22 + 24·z' + 8·z'2], size: O(n1) [z']
replace: runtime: O(n2) [6 + 4·z'' + z''2], size: O(n1) [z' + z'']
if_replace: runtime: O(n2) [8 + 4·z1 + z12], size: O(n1) [z'' + z1]
sort: runtime: O(n3) [1 + 181·z + 225·z2 + 91·z3], size: O(n2) [z + z2]

(43) FinalProof (EQUIVALENT transformation)

Computed overall runtime complexity

(44) BOUNDS(1, n^3)